﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddMovieScheduleUserControl.ascx.cs" Inherits="MBS.UserControls.MovieScheduleUserControl.AddMovieScheduleUserControl1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<style type="text/css">
    .style1
    {
        width: 100%;
    }
    .style2
    {
        height: 32px;
    }
</style>
<script type="text/javascript" src="jquery-1.4.1.js"></script>
<script type="text/javascript">

    $(document).ready(function () {
        $('[id$=WeekdayFeeTextBox]').change(function () {
            if (!$(this).val().match(/^-{0,1}\d*\.{0,1}\d+$/)) {
                $(this).val('0.00');
            }
        });

        $('[id$=WeekendFeeTextBox]').change(function () {
            if (!$(this).val().match(/^-{0,1}\d*\.{0,1}\d+$/)) {
                $(this).val('0.00');
            }
        });
    });
    
    </script> 

<table>
    <tr>
        <td width="10%">
            <asp:Label ID="movieLabel" runat="server" Text="Movie" CssClass="label"></asp:Label>
        </td>
        <td width="20%">
            <asp:DropDownList ID="movieDropDownList" runat="server" AutoPostBack="true"
            onselectedindexchanged="movieDropDownList_SelectedIndexChanged" Height="20px" 
                Width="143px">
            </asp:DropDownList>
       
        </td>
        <td width="20%">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                ControlToValidate="movieDropDownList" ErrorMessage="Movie field is required" 
                ForeColor="Red"></asp:RequiredFieldValidator>
        </td>
        <td width="10%"></td>
        <td width="20%"></td>
        <td width="20%"></td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="cinemaLabel" CssClass="label" runat="server" Text="Cinema"></asp:Label>
        </td>
        <td>
            <asp:DropDownList ID="cinemaDropDownList" runat="server" AutoPostBack="true"
                onselectedindexchanged="cinemaDropDownList_SelectedIndexChanged" 
                Height="20px" Width="143px">
            </asp:DropDownList>
       
        </td>
        <td >
            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                ControlToValidate="cinemaDropDownList" ErrorMessage="Cinema field is required" 
                ForeColor="Red"></asp:RequiredFieldValidator>
        </td>

        <td>
            <asp:Label ID="weekendFeeLabel" CssClass="label" runat="server" Text="Weekend Fee (SGD)"></asp:Label>
        </td>
        <td>
            <asp:TextBox ID="WeekendFeeTextBox" CssClass="textbox" runat="server">0.00</asp:TextBox>
       </td>
        <td ></td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="theatreLabel" CssClass="label" runat="server" Text="Screen"></asp:Label>
        </td>
        <td >
            <asp:DropDownList ID="screenDropDownList" runat="server" 
                onselectedindexchanged="screenDropDownList_SelectedIndexChanged" 
                Height="20px" Width="142px">
            </asp:DropDownList>
        </td>
        <td >
            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                ControlToValidate="screenDropDownList" ErrorMessage="Screen field is required" 
                ForeColor="Red"></asp:RequiredFieldValidator>
        </td>
        <td >
            <asp:Label ID="weekdayFeeLabel" CssClass="label" runat="server" Text="Weekday Fee (SGD)"></asp:Label>
        </td>
        <td > 
            <asp:TextBox ID="WeekdayFeeTextBox" runat="server" CssClass="textbox" >0.00</asp:TextBox>
        </td>
        <td ></td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="startDateLabel" CssClass="label" runat="server" Text="Start Date"></asp:Label>
        </td>
        <td>
                <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
                <asp:CalendarExtender ID="startDateCalendarAjax" TargetControlID="StartDateTextBox" runat="server" CssClass="custom-calendar">
                    </asp:CalendarExtender>
                    <asp:TextBox ID="StartDateTextBox" runat="server"  ></asp:TextBox>
        </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                ControlToValidate="StartDateTextBox" ErrorMessage="Start Date is required" 
                ForeColor="Red"></asp:RequiredFieldValidator>
        </td>
        <td>
            <asp:Label ID="StartTimeLabel" CssClass="label" runat="server" Text="Start Time"></asp:Label>
        </td>
        <td >
            <asp:TextBox ID="StartTimeTextBox"
            runat="server" Width="60px" Text="HH:MM" CssClass="textbox"></asp:TextBox>
      
       </td>
        <td>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ControlToValidate="StartTimeTextBox" Display="Dynamic" 
                ErrorMessage="Show Start Time must be in HH:MM format" ForeColor="Red" 
                ValidationExpression="\d\d:\d\d"></asp:RegularExpressionValidator>
            
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="StartTimeTextBox" ErrorMessage="Show Start Time is required" 
                ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
            
         </td>
    </tr>
    
     <tr>
     <td>
            <asp:Label ID="endDateLabel" CssClass="label" runat="server" Text="End Date"></asp:Label>
        </td>
        <td> 
        
            
                <asp:CalendarExtender ID="endDateCalendarAjax" TargetControlID="EndDateTextBox" runat="server" CssClass="custom-calendar">
                    </asp:CalendarExtender>
                    <asp:TextBox ID="EndDateTextBox" runat="server"  ></asp:TextBox>
       </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                ControlToValidate="EndDateTextBox" ErrorMessage="End Date is required" 
                ForeColor="Red"></asp:RequiredFieldValidator>
           
            <asp:CustomValidator ID="CustomValidator1" runat="server" 
                ControlToValidate="EndDateTextBox" 
                ErrorMessage="End Date must be after or equal to start date" ForeColor="Red" 
                onservervalidate="ValidateDate" Display="Dynamic"></asp:CustomValidator>
        </td>
        <td>
        <asp:Label ID="EndTimeLabel" CssClass="label" runat="server" Text="End Time"></asp:Label>
        </td>
        <td>
         <asp:TextBox ID="EndTimeTextBox" 
            runat="server" Width="60px" Text="HH:MM" CssClass="textbox"></asp:TextBox>
        </td>
         <td>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                ControlToValidate="EndTimeTextBox" Display="Dynamic" 
                ErrorMessage="Show End Time must be in HH:MM format" ForeColor="Red" 
                ValidationExpression="\d\d:\d\d"></asp:RegularExpressionValidator>
           <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="EndTimeTextBox" ErrorMessage="Show End Time is required" 
                ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:CustomValidator ID="CustomValidator2" runat="server" 
                ControlToValidate="EndTimeTextBox" ErrorMessage="CustomValidator" 
                ForeColor="Red" onservervalidate="ValidateTime" Display="Dynamic">Show End Time must be after Show Start Time</asp:CustomValidator>
         </td>
    </tr>
  
   
    <tr>
    <td colspan ="3">
    </td>
        <td colspan ="3">
            <asp:Button ID="addScheduleButton" runat="server" onclick="AddSchedule_Click" Text="Add Schedule" CssClass="button"/>
         </td>
    </tr>
</table>